package com.qfedu.mbtiapi.controller;

import com.qfedu.mbtiapi.entity.UserTest;
import com.qfedu.mbtiapi.service.UserTestService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

/**
 * 用户测试表(UserTest)表控制层
 *
 * @author makejava
 * @since 2024-11-01 10:53:41
 */
@RestController
@RequestMapping("api/usertest")
@Tag(name = "测试人格")
public class UserTestController {
    /**
     * 服务对象
     */
    @Resource
    private UserTestService service;

    @Operation(summary = "创建测试")
    @GetMapping("start")
    public String start(Integer uid){
        return service.startTest(uid);
    }
    @Operation(summary = "结束测试")
    @GetMapping("end")
    public String end(Integer id){
        return service.endTest(id);
    }
    @Operation(summary = "我的测试")
    @GetMapping("my")
    public List<UserTest> my(Integer uid){
        return service.queryByUid(uid);
    }

}